﻿using Acme.SmartWMS.Location.StorageLocationService;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace Acme.SmartWMS.Web.Controllers.Location
{
    public class StorageLocationController : Controller
    {
        private readonly IStorageLocationAppService _storageLocationAppService;

        public StorageLocationController(IStorageLocationAppService storageLocationAppService)
        {
            _storageLocationAppService = storageLocationAppService;
        }


        public IActionResult Index()
        {
            return View();
        }

        public IActionResult StorageLocationSelIndex()
        {
            return View();
        }

        /// <summary>
        /// 查询显示
        /// </summary>
        /// <param name="name"></param>
        /// <param name="limit"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public async Task<IActionResult> GetPageStorage(string? code,int isDisabled, int limit, int page)
        {
            var res = await _storageLocationAppService.GetPageStorage(code, isDisabled, limit, page);
            return Json(new { data = res.Queryable, code = 0, count = res.RowCount });
        }
    }
}
